package cn.edu.fzu.homemaking.chat.domain.ko;

public class DoubleLongKey {
    private final long i;
    private final long j;

    private final int  hash;

    public static final DoubleLongKey create(long i, long j) {
        return new DoubleLongKey(i, j);
    }


    private DoubleLongKey(long i, long j) {
        this.i = i;
        this.j = j;
        this.hash = (int) (31 * i + j);
    }


    @Override
    public int hashCode() {
        return hash;
    }


    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof DoubleLongKey) {
            DoubleLongKey ko = (DoubleLongKey) obj;
            return i == ko.i && j == ko.j;
        }
        return false;
    }


    @Override
    public String toString() {
        return new StringBuilder().append(i).append('-').append(j).toString();
    }
}
